package com.sc.VenusQueryBeta.model.account.changmian;

import com.hengjun.kingstar.sdk.base.BaseModel;
import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.account.AccountApi;
import com.sc.VenusQueryBeta.contract.account.changmian.ChangMianContract;
import com.sc.VenusQueryBeta.model.bean.account.AllRoomListBean;
import com.sc.VenusQueryBeta.model.bean.account.CurrencyListBean;
import com.sc.VenusQueryBeta.model.bean.account.MaxChangemonthBean;
import com.sc.VenusQueryBeta.model.bean.account.changmian.ChangMianPopBean;
import com.sc.VenusQueryBeta.model.bean.account.changmian.ChangmianBean;

import io.reactivex.Observable;

/**
 * Created by SC-02 on 2018/9/19.
 * 场面明细model 继承Basemodel 并且实现契约累的model方法
 */


public class ChangMianModel extends BaseModel implements ChangMianContract.IChangMianModel{
/**
 * 实例化对象
 */
public static ChangMianModel newInstance(){
    return new ChangMianModel();
}

    @Override
    public Observable<ChangmianBean> queryClientWinnumMessage(String serverAddress, String projectName, int serverPort, int clientindex, String roommonth, String roomyear, String currencynameCN) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").
                queryClientWinnumMessage(clientindex,roommonth,roomyear,currencynameCN).compose(RxHelper.<ChangmianBean>rxSchedulerHelper());
    }
    //查询厅(根据账房那边排序)
    @Override
    public Observable<CurrencyListBean> queryAllCurrencyList(String serverAddress, String projectName, int serverPort) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").queryCurrencyList().compose(RxHelper.<CurrencyListBean>rxSchedulerHelper());

    }

//    //查询厅(根据账房那边排序)
//    @Override
//    public Observable<AllRoomListBean> queryAllRoomList(String serverAddress, String projectName, int serverPort) {
//        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").queryAllRoomList().compose(RxHelper.<AllRoomListBean>rxSchedulerHelper());
//
//    }

//    //查询最大日期
//    @Override
//    public Observable<MaxChangemonthBean> queryMaxChangemonth(String serverAddress, String projectName, int serverPort, int roomid) {
//        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").
//                queryMaxChangemonth(roomid).compose(RxHelper.<MaxChangemonthBean>rxSchedulerHelper());
//    }

    //場面明細pop
    @Override
    public Observable<ChangMianPopBean> changmianpop(String serverAddress, String projectName, int serverPort, int winnumindex) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").
                changmianpop(winnumindex).compose(RxHelper.<ChangMianPopBean>rxSchedulerHelper());
    }
}
